package com.website.dayouziblog.exception;

import lombok.Data;

/**
 * 自定义异常类(可以用来throw的异常类)
 */
@Data
public class BaseException extends RuntimeException {

    private static final long serialVersionUID = -4198842878380665454L;
    //状态码
    private String code;

    //提示信息
    private String message;

    //构造方法
    public BaseException() {
        super();
    }

    //自定义异常构造方法
    public BaseException(BaseErrorEnum baseErrorEnum){
        super(baseErrorEnum.getCode());
        this.code = baseErrorEnum.getCode();
        this.message = baseErrorEnum.getMessage();
    }


}
